package br.com.devteam.sgap.repository;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;

public interface BasicDAO {

	public <T> T findById(Class<T> entityClass, Serializable id);

	public abstract <T> List<T> findByNamedQuery(String s,
			Map<String, Object> map);

	public abstract <T> List<T> findByNamedQuery(String s);

	public abstract <T> List<T> findByQuery(String hql,
			Map<String, Object> namedParams);

	public abstract <T> List<T> findByNamedQuery(String s,
			Map<String, Object> map, int maxResults);

	public abstract <T> List<T> findByNamedQuery(String s, int maxResults);

	public abstract <T> List<T> findByQuery(String s, Map<String, Object> map,
			int maxResults);

	public abstract <T> T save(T abstractbean);

	public abstract <T> T saveFlushAndClear(T abstractbean);

	public abstract <T> void update(T abstractbean);

	public abstract <T> void delete(T abstractbean);

	public EntityManager getEntityManager();

}